![]() |
Q1: How to debug in
PAT? Answer:
PAT does not provide runtime debugger. Nevertheless, you can easily do the
debugging using variable range checking, assertions or simulator.
Q2: How do I know that my
model is error-free? Answer: After finishing your model, you can check the syntax of your model by
clicking Check Grammar button. If your model is syntactically correct,
PAT will display the parsed model in the output window in the bottom. You can
check the parsed model to confirm that your model is the one you want.
Note: sometimes, a missing bracket or simple typo can produce a
different model. All module parsers in PAT support error recovery, e.g., they can
automatically add missing brackets or remove extra brackets or semi-colons.
However, all error recovery information will be displayed as warnings in
Error List window (see the Figure below). You need to be careful if
there are warnings after parsing, because the error recovery feature may parse
the model to a different one than you want. We suggest you to clear out
all warnings before doing any analysis.
Q3: When I run the model, PAT
crashes like following. What should I do? Answer: PAT tries to catch all the exceptions internally. However, if the model gives
a stack overflow exception, then PAT cannot catch it. The reason of stack
overflow exception is most likely because your model has self-loop like
following example. Be careful when using ifa with
looping back. var x = 0; Q4: Is it possible to imprt
new Lib file in local folder? Answer: Yes. The complied .dll file can either be inside the Lib folder of the
installation folder or the under the same directory with the model file. Q5: For the following
program, can the two processes P() and Q() synchronise on the event a? Then how
to make them synchronise on 'a' and preserve the execution of statement block
({x++}) in an atomic fashion? Answer: A intuitive solution is to put the event 'a' and increment statement in a
'atomic' action as follows:
Then x will be updated right after a is engaged, and a will be
synchronised. The other possible solution could be:
P = ifa(x==1) {Skip} else{P};